﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UwinEducation.Domain.Entities
{
    [Table("sys_roles")]
    public class Role : EntityBase
    {
        public Guid Id { get; private set; }
        public string Name { get; private set; }
        public string Description { get; private set; }

        //public ICollection<RolePermission> RolePermissions { get; private set; }

        private Role() { }

        public static Role Create(string name, string description)
        {
            return new Role
            {
                Id = Guid.NewGuid(),
                Name = name,
                Description = description
            };
        }

        public void Update(string name, string description)
        {
            Name = name;
            Description = description;
        }
    }
}
